package cn.jee.entity;

import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
public class Stu2 {

  private Long id;
  @NotBlank
  @Size(min=2,max=6,message="{name.size.error}")
  private String name;
  @DecimalMin(value="12",inclusive = true)//>=12
  private double java;
  @DecimalMax("100")
  double math;
  @Min(value=18,message = "{age.outof.range}")
  int age;
  @Valid
  Address address;

  public Stu2(String name, double java, double math) {
    this.name = name;
    this.java = java;
    this.math = math;
  }
}